package reflect;

public class Person {
    private String name ="张三";
    private int age = 18;
    public Person (){}

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void sayHello(){
        System.out.println(name+"Hello!");
    }
    public void sayHi(){
        System.out.println(name+"Hi!");
    }
    public void watchTV(){
        System.out.println(name+"看电视");
    }
    public void sing(){
        System.out.println(name+"唱歌");
    }
    private void dosome(){

        System.out.println("Person的私有方法！！");

    }
    public void doSomeThing(String something,int count){
        for(int i=0;i<count;i++) {
            System.out.println(name + "正在做" + something + i + "次");
        }
    }
    public void doSomeThing(String something){
        System.out.println(name+"正在"+something);

    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
